<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>学校发展规划</title>
<%@ include file="/module/js.jsp"%>
</head>
<body>
	<form action="#" name="Form" id="Form" method="post">
		<input type="hidden" name="idList" id="idList"/>
		<%@ include file="/module/orderField.jsp"%>
		<table cellpadding="1" cellspacing="1" border="0">
			<c:if test="${_login_user_type==2}">
			<tr>
			    <td>
			    
			    <input type="button" id="btnQuery" value="查询"
					class="inputButton" /></td>
				<td>
				 <kl:permission permisstionList="${permisstionList}"
                    currentUser="${_login_console_user}"
                    currentCatalogId="<%=CatalogUtils.getCatalogId(\"JKY_JKS_XXFZGH\")%>" key="add"> 
				<input type="button" id="btnAdd" value="添 加" 
					class="inputButton" />
				</kl:permission>
				</td>
				<td>
				<kl:permission permisstionList="${permisstionList}"
                    currentUser="${_login_console_user}"
                    currentCatalogId="<%=CatalogUtils.getCatalogId(\"JKY_JKS_XXFZGH\")%>" key="delete">
				<input type="button" id="btnDelete" value="删 除"
					 class="inputButton"/>
				</kl:permission>
				</td>
		    	<td><input type="button" id="btnExport" value="导出"
				 class="inputButton"/></td>		 
			</tr>
	   </c:if>	
		</table>
		 <table cellpadding="1" cellspacing="1" style="width:80%;">
		<tr>
				<td>标题：</td>
				<td><input type="text" name="title" id="title"  value="" autocomplete="off" class="inputText2" /></td>
				<td>创建人：</td>
				<td><input type="text" name="creatorname" id="creatorname" value=""  autocomplete="off" class="inputText2" /></td>
			</tr>
			 <tr>
				 <td>开始日期：</td>
				 <td colspan="4">
					 <input type="text" name="begintime" id="begintime"   autocomplete="off"
							class="Wdate inputText2" value=""
							onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>结束日期
					 <input type="text" name="endtime" id="endtime"   autocomplete="off"
							class="Wdate inputText2" value=""
							onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
				 </td>
			 </tr>
		</table>
     	<table id="dg"   style="width:100%;"
			data-options="pagination:true,collapsible:true,url:'${basePath}/developmentPlanning/list',method:'post',remoteSort:true">
			<thead>
				<tr>
					<th data-options="field:'fzid',checkbox:true,width:80,align:'center'"></th>
					<th data-options="field:'subject',nowrap:true,width:280,align:'center',sortable:true,formatter:formater">标题</th>
					<th data-options="field:'ksrq',nowrap:true,width:280,align:'center',sortable:true,formatter:formatDate">开始日期</th>
					<th data-options="field:'jsrq',nowrap:true,width:280,align:'center',sortable:true,formatter:formatDate">结束日期</th>
					<th data-options="field:'creatorName',nowrap:true,width:200,align:'center',sortable:true">创建人</th>
					<th data-options="field:'createTime',nowrap:true,width:280,align:'center',sortable:true,formatter:formatDate">创建时间</th>
				</tr>
			</thead>
		</table>
	</form>
	<script type="text/javascript">
	    function formater(value, row, index) {
			return "<a href='${basePath}/developmentPlanning/view?fzid=" + row.fzid + "'>"+ row.subject + "</a>";
		}	
	$(document).ready(
			function() {

			$('#dg').datagrid({
			   rowStyler: function(index,row){
			   },
			   onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
	           		if (data.rows.length > 0) {
					}
				},
			});
			//查询
			$('#btnQuery').click(function(){
				$('#dg').datagrid('load',{
					title: $('#title').val(),
					creatorname: $('#creatorname').val(),
                    begintime: $('#begintime').val(),
                    endtime: $('#endtime').val()
				});
			});
	 		$('#easyui-ck').click(function() {   
				var data = $("#dg").datagrid("getSelections");
				for (var i = 0; i < data.length; i++) {
            	}
			});
			$('#btnAdd').click(function() {
				window.location.href = "${basePath}/developmentPlanning/addInInt";
			});
			$('#btnDelete').click(function() {
			   $("#idList").val("");
				var count = 0;
				var idList = new Array();
				var sels = $("#dg").datagrid("getSelections");
				for(var i in sels){
					idList.push(sels[i].fzid);
					count++;
				}

				if (count == 0) {
					layer.alert("您至少选择一条删除记录信息", {icon: 3});
					return false;
				}else{
				  	layer.confirm("您是否删除当前选中数据信息", {icon: 3, title:'提示',skin:'layer-ext-moon'}, function(index){
						$("#idList").val(idList);
						document.Form.action = "${basePath}/developmentPlanning/delete";
						document.Form.submit();
				  	},function(index){
						layer.close(index);
				  	});
				}
			});
		});
		// 导出
		$('#btnExport').on('click', function(){
			   layer.confirm("您确定要导出吗?", function(index){
				   //var rows = $("#dg").datagrid("getRows"); {icon: 3, title:'提示',skin:'layer-ext-moon'},
				  // var bodyData = JSON.stringify(rows);  //转成json字符串
				   // $("#bodyData").val(JSON.stringify(rows));
					    document.Form.action = "${basePath}/developmentPlanning/export_developmentPlanning";
						document.Form.submit();
						layer.close(index);
     		 });
			});
	</script>
</body>
</html>
